<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { request } from '@/utils/request'

const status = ref('加载中...')

const getHealthStatus = async () => {
  try {
    const response = await request.get('/health')
    status.value = response.data.status
  } catch (error) {
    status.value = '连接失败'
  }
}

onMounted(() => {
  getHealthStatus()
})
</script>

<template>
  <div class="app-container">
    <h1>Hello {{ status }}</h1>
  </div>
</template>

<style scoped>
.app-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  text-align: center;
}
</style>
